import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '论文id',
    align:"center",
    dataIndex: 'paperId'
   },
   {
    title: '教师id',
    align:"center",
    dataIndex: 'teacherId'
   },
   {
    title: '选题背景分数',
    align:"center",
    dataIndex: 'topicBackground'
   },
   {
    title: '文献综述',
    align:"center",
    dataIndex: 'literatureReview'
   },
   {
    title: '目的及意义',
    align:"center",
    dataIndex: 'purposeSignificance'
   },
   {
    title: '研究内容的合理性',
    align:"center",
    dataIndex: 'rationality'
   },
   {
    title: '研究方法的科学性',
    align:"center",
    dataIndex: 'scientificity'
   },
   {
    title: '难易度及工作量',
    align:"center",
    dataIndex: 'difficultyWorkload'
   },
   {
    title: '研究成果的价值',
    align:"center",
    dataIndex: 'achievements'
   },
   {
    title: '研究结果的新颖性',
    align:"center",
    dataIndex: 'novelty'
   },
   {
    title: '摘要',
    align:"center",
    dataIndex: 'abstract'
   },
   {
    title: '文字论述',
    align:"center",
    dataIndex: 'writtenDiscussion'
   },
   {
    title: '参考文献',
    align:"center",
    dataIndex: 'reference'
   },
   {
    title: '论文评分',
    align:"center",
    dataIndex: 'paperAssessment'
   },
   {
    title: '是否推荐为优秀论文',
    align:"center",
    dataIndex: 'recommend'
   },
   {
    title: '论文评语',
    align:"center",
    dataIndex: 'paperComments'
   },
   {
    title: '论文建议',
    align:"center",
    dataIndex: 'paperRecommendations'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '论文id',
    field: 'paperId',
    component: 'Input',
  },
  {
    label: '教师id',
    field: 'teacherId',
    component: 'Input',
  },
  {
    label: '选题背景分数',
    field: 'topicBackground',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入选题背景分数!'},
          ];
     },
  },
  {
    label: '文献综述',
    field: 'literatureReview',
    component: 'InputNumber',
  },
  {
    label: '目的及意义',
    field: 'purposeSignificance',
    component: 'InputNumber',
  },
  {
    label: '研究内容的合理性',
    field: 'rationality',
    component: 'InputNumber',
  },
  {
    label: '研究方法的科学性',
    field: 'scientificity',
    component: 'InputNumber',
  },
  {
    label: '难易度及工作量',
    field: 'difficultyWorkload',
    component: 'InputNumber',
  },
  {
    label: '研究成果的价值',
    field: 'achievements',
    component: 'InputNumber',
  },
  {
    label: '研究结果的新颖性',
    field: 'novelty',
    component: 'InputNumber',
  },
  {
    label: '摘要',
    field: 'abstract',
    component: 'InputNumber',
  },
  {
    label: '文字论述',
    field: 'writtenDiscussion',
    component: 'InputNumber',
  },
  {
    label: '参考文献',
    field: 'reference',
    component: 'InputNumber',
  },
  {
    label: '论文评分',
    field: 'paperAssessment',
    component: 'InputNumber',
  },
  {
    label: '是否推荐为优秀论文',
    field: 'recommend',
    component: 'Input',
  },
  {
    label: '论文评语',
    field: 'paperComments',
    component: 'Input',
  },
  {
    label: '论文建议',
    field: 'paperRecommendations',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  paperId: {title: '论文id',order: 0,view: 'text', type: 'string',},
  teacherId: {title: '教师id',order: 1,view: 'text', type: 'string',},
  topicBackground: {title: '选题背景分数',order: 2,view: 'number', type: 'number',},
  literatureReview: {title: '文献综述',order: 3,view: 'number', type: 'number',},
  purposeSignificance: {title: '目的及意义',order: 4,view: 'number', type: 'number',},
  rationality: {title: '研究内容的合理性',order: 5,view: 'number', type: 'number',},
  scientificity: {title: '研究方法的科学性',order: 6,view: 'number', type: 'number',},
  difficultyWorkload: {title: '难易度及工作量',order: 7,view: 'number', type: 'number',},
  achievements: {title: '研究成果的价值',order: 8,view: 'number', type: 'number',},
  novelty: {title: '研究结果的新颖性',order: 9,view: 'number', type: 'number',},
  abstract: {title: '摘要',order: 10,view: 'number', type: 'number',},
  writtenDiscussion: {title: '文字论述',order: 11,view: 'number', type: 'number',},
  reference: {title: '参考文献',order: 12,view: 'number', type: 'number',},
  paperAssessment: {title: '论文评分',order: 13,view: 'number', type: 'number',},
  recommend: {title: '是否推荐为优秀论文',order: 14,view: 'text', type: 'string',},
  paperComments: {title: '论文评语',order: 15,view: 'text', type: 'string',},
  paperRecommendations: {title: '论文建议',order: 16,view: 'text', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}